1. Field of the Invention
The present invention relates generally to a method and apparatus for managing memory in a shared environment. Still more particularly, the present invention relates to an apparatus and a computer implemented method for improving memory coalescing in a virtualized hardware environment.
2. Description of the Related Art
Platform virtualization involves the simulation of computer environments. The advantages associated with platform virtualization include increases in flexibility and opportunities to consolidate workloads from multiple computers onto fewer systems running multiple concurrent virtual machine environments. By consolidating workloads, the overall system utilization is improved and complexities associated with managing many independent physical systems are reduced.
While platform level virtualization provides high value, the required level of isolation and flexible allocation of resources, such as, the central processing unit (CPU) and memory to aid in the deployment of those resources is costly because each virtual platform is effectively an individual system with many of its resources dedicated and non-sharable. Memory, such as random access memory (RAM), and the data contained within the memory are examples of resources dedicated to each virtual platform.
Memory coalescing is a mechanism that identifies duplicate memory ranges and redirects the references to the duplicate memory ranges to a single shared copy. The shared instance would reduce the aggregate memory footprint and allow a system run at optimal levels with a reduced amount of total memory.
Currently, brute computational force can be applied in the underlying memory management layers of a virtual machine provider to find matching regions of memory that can be consolidated into a single shared memory range used by all virtual instances until a modification event happens. Applying the brute computational force approach does not require advanced integration and is easy to pursue with available shared knowledge in the operating system (OS) and virtualization platform memory management layers.
However, significant computational power is required to scan large amounts of memory with a high frequency of “misses” resulting. Because of the computational requirement, scans must occur as background activity consuming only a small perceived amount of system resources so as not to impact running workloads that deliver business value. With this approach, data must reside in memory long enough for the scans to find and consolidate duplicate ranges. As a result, only minor incremental value is achieved unless there are enough duplicate ranges that reside for long periods of time in the system. Transient data or rapid changes to the required memory footprint are not consolidated in time to minimize aggregate memory requirements on a system.